<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.css" rel="stylesheet" />
		<link href="../css/header.css" rel="stylesheet" />
	</head>

	<body>
		<!-- 头部标题栏 -->
		<header class="mui-bar mui-bar-nav title">
			<h1 class="mui-title title-color">信息</h1>
		</header>
		<!-- 主体部分   -->
		<div class="mui-content">
			<!-- mListmedia 图文列表 -->
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;" id="link_myface">
						<span  class=" mui-icon mui-icon-arrowright mui-pull-right" style="line-height: 42px; color: darkgray; margin-left: 3px;"></span>
						<img id="image" class="mui-media-object mui-pull-right" src="../css/registLogin/1.jpg" style="line-height: 42px;">
						<div class="mui-media-body font-style"> 
							头像					
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a id="link_nickname" href="javascript:;">
						<span  class=" mui-icon mui-icon-arrowright mui-pull-right" style="line-height: 42px; color: darkgray; margin-left: 3px;"></span>
						<span id="nickname"class="mui-pull-right" style="line-height: 42px; color: darkgray; font-size: 16px;">舒克、舒克</span>
						<div class="mui-media-body font-style">
							昵称
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<span  class=" mui-icon mui-icon-arrowright mui-pull-right" style="line-height: 42px; color: darkgray; margin-left: 3px;"></span>
						<span id="username"class="mui-pull-right" style="line-height: 42px; color: darkgray; font-size: 16px;">舒克、舒克</span>
						<div class="mui-media-body font-style">
						    账号
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a id="link_myqrcode" href="javascript:;">
						<span  class=" mui-icon mui-icon-arrowright mui-pull-right" style="line-height: 42px; color: darkgray;margin-left: 3px;"></span>
						<img class="mui-media-object mui-pull-right" src="../images/qrcode.png"style="max-width: 38px; max-height: 38px;">
						<div class="mui-media-body font-style">
						    二维码
						</div>
					</a>
				</li>
			</ul>
			<br />
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<a id="link_logout" href="javascript:;">
						<div class="mui-media-body font-style" style="text-align: center;"> 
							退出登录					
						</div>
					</a>
				</li>
			</ul>
		</div>
		<script type="text/javascript" src="../js/app.js" ></script>
		<script src="../js/mui.js"></script>
		<script type="text/javascript">
			mui.init();
			mui.plusReady(function () {
			    //获取当前webview对象，并且刷新登录用户
				var currentWebview =plus.webview.currentWebview();
				currentWebview.addEventListener("show",function(){
					//刷新当前用户信息
					refreshUserInfo();
				});
				
				//头像
				document.getElementById("link_myface").addEventListener("tap",function(){
					mui.openWindow("wechat-myface.html","wechat-myface");
				}) 
				
				
				//昵称
				document.getElementById("link_nickname").addEventListener("tap",function(){
					mui.openWindow("wechat-mynickname.html","wechat-mynickname");
				})
				
				//二维码
				document.getElementById("link_myqrcode").addEventListener("tap",function(){
					mui.openWindow("wechat-myqrcode.html","wechat-myqrcode");
				})
				
				//退出登录
				var link_logout=document.getElementById("link_logout");
				link_logout.addEventListener("tap",function(){
					app.userLogout();
					mui.openWindow("login.html","login");
				})
				
				
				//刷新用户信息的函数
				function refreshUserInfo(){
					var user=app.getUserGlobalInfo();
					var faceImage=user.faceImage;
					var username=user.username;
					var nickname=user.nickname;
					
					var span_nickname=document.getElementById("nickname");
					var span_username=document.getElementById("username");
					//动态将个人信息展示到对应位置
					span_nickname.innerHTML=nickname;
					span_username.innerHTML=username;
					if(app.isNotNull(faceImage)){
						var image=document.getElementById("image");
						image.src=app.imgServerUrl+faceImage;
					}
				}
			})
		</script>
	</body>

</html>
